package com.ss.android.k.d;

import android.content.Context;
import android.util.SparseArray;
import android.view.View;
import android.widget.TextView;

import java.util.WeakHashMap;

public final class c {
    static {
        new WeakHashMap();
    }

    private final SparseArray c;
    public View a;
    private View b;

    public c(View arg1) {
        this();
        this.b = arg1;
        this.a = arg1;
    }

    public c() {

        this.c = new SparseArray();
    }

    public final c a(View.OnClickListener arg2) {
        if (this.a != null) {
            this.a.setOnClickListener(arg2);
        }

        return this;
    }

    public final Context a() {
        Context v0 = this.b != null ? this.b.getContext() : null;
        return v0;
    }

    public final View a(int arg3) {
        View v0_1;
        v0_1 = (View) this.c.get(arg3);
        if (v0_1 == null) {
            if (this.b != null) {
                v0_1 = this.b.findViewById(arg3);
            }

            this.c.put(arg3, v0_1);
        }

        return v0_1;
    }

    public final c a(CharSequence arg2) {
        if ((this.a instanceof TextView)) {
            ((TextView) this.a).setText(arg2);
        }

        return this;
    }

    public final c a(boolean arg2) {
        if (this.a != null) {
            this.a.setSelected(arg2);
        }

        return this;
    }

    public final c b(int arg2) {
        this.a = this.a(arg2);
        return this;
    }

    public final c c(int arg2) {
        if ((this.a instanceof TextView)) {
            ((TextView) this.a).setText(arg2);
        }

        return this;
    }

    public final c d(int arg2) {
        if (this.a != null && this.a.getVisibility() != arg2) {
            this.a.setVisibility(arg2);
        }

        return this;
    }
}

